package com.bee.user.controller.web;

import com.bee.auth.client.AuthHolder;
import com.bee.commons.vo.Result;
import com.bee.commons.web.constrants.WebConst;
import com.bee.user.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Damin.yang
 * @date 2019/08/17 17:14
 */
@Slf4j
@Api(tags = "用户管理模块")
@RestController
@RequestMapping(WebConst.MANAGEMENT + "/user")
public class UserSysController {

    @Autowired
    private UserService userService;

    @ApiOperation(value = "当前登录用户信息接口", notes = "当前登录用户信息")
    @GetMapping("/current")
    public Result<?> getUser() {
        return Result.success(userService.queryById(AuthHolder.getUserId()));
    }

    @ApiOperation(value = "获取用户信息接口", notes = "获取用户信息")
    @GetMapping("/getUser")
    public Result<?> getUser(
            @ApiParam("用户id") @RequestParam Long userId
    ) {

        return Result.success(null);
    }
}
